package com.lyh.common.core.domain.entity;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.lyh.common.annotation.Excel;
import com.lyh.common.annotation.Excel.ColumnType;
import com.lyh.common.annotation.Excel.Type;
import com.lyh.common.core.domain.BaseEntity;

/**
 * 用户对象 sys_user
 *
 * @author lyh
 */
@Data
@TableName("sys_user")
public class SysUser extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 用户ID */
    @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
    @TableId
    @ApiModelProperty(example = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /** 用户账号 */
    @Excel(name = "账户")
    private String userName;

    /** 用户昵称 */
    @Excel(name = "用户名称")
    private String nickName;

    /** 手机号码 */
    @Excel(name = "手机号码")
    private String phonenumber;

    private String sex;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /** 密码 */
    private String password;

    /** 帐号状态（0正常 1停用） */
  //  @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
    private String status;

    @TableField(exist = false)
    private String statusName;

    /** 最后登录IP */
  //  @Excel(name = "最后登录IP", type = Type.EXPORT)
    private String loginIp;
    //头像
    private String avatar;

    /** 最后登录时间 */
 //   @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
    private Date loginDate;

    /** 会员id */
    @Excel(name = "会员id")
    private String memberId;

    //会员等级

    private Integer memberLeve;

    //会员等级
    @TableField(exist = false)
    private String memberLeveName;

    //门店长等级
    private String mstoreLeve;

    @TableField(exist = false)
    private String mstoreLeveNmae;
    //是否是顶级邀请人
    private Integer topInviteFlag;

    @TableField(exist = false)
    private String  topInviteName;

    //邀请码
    private String topInviteCode;

    private Long parentId;

    //是否 有顶级
    private Integer topUserFlag;

    @TableField(exist = false)
    private String  topUserFlagName;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long topUserId;

    //  1 web  0 app
    private Integer isAdmin;

    private Integer delFlag;
    //直接、间接推广人邀请码（会员id）,拼接--会员升级使用
    private String indirectInviteCodes;

  //  @Excel(name = "是否门店长")
    private Boolean isMstore;

    /** 角色对象 */
    @TableField(exist = false)
    private List<SysRole> roles = new ArrayList<>();

    @TableField(exist = false)
    private Long[] roleIds;

    private String payPassword;

    private Boolean faceIdentifyFlag = false;

    //0 普通用户 1 普通健康大使 2 门店健康大使 3 1+2
    private Integer isVip;

    @TableField(exist = false)
    @ApiModelProperty(example = "账户余额")
    private BigDecimal accountBalance;

    @TableField(exist = false)
    @ApiModelProperty(example = "零钱")
    private BigDecimal changes;


    @TableField(exist = false)
    @ApiModelProperty(example = "消费券")
    private BigDecimal consumerCouponNum;

    @TableField(exist = false)
    @ApiModelProperty(example = "资产通证")
    private BigDecimal assetEvidenceNum;

    @TableField(exist = false)
    @ApiModelProperty(example = "积分")
    private Long integral;

    @TableField(exist = false)
    @ApiModelProperty(example = "权益额度")
    private BigDecimal equityLimit;

    @TableField(exist = false)
    @ApiModelProperty(example = "股权积分")
    private BigDecimal equityPoints;

    @ApiModelProperty(example = "返佣比例")
    private BigDecimal rebatesRate;

    @ApiModelProperty(example = "是否返佣")
    private Integer rebatesFlag;

    @TableField(exist = false)
    @ApiModelProperty(example = "直推人数")
    private Integer inviteNum;

    @ApiModelProperty(example = "成为普通健康大使时间")
    private Date vipCommomTime;

    @ApiModelProperty(example = "成为门店健康大使时间")
    private Date vipStoreTime;

    @ApiModelProperty(example = "支付宝账号")
    private String zfbAccount;

    @ApiModelProperty(example = "支付宝实名")
    private String realName;

    @TableField(exist = false)
    @ApiModelProperty(example = "门店订单数")
    @Excel(name = "门店订单数")
    private Integer storeOrderNum=0;

    @TableField(exist = false)
    @ApiModelProperty(example = "线上订单数")
    @Excel(name = "线上订单数")
    private Integer onlineOrderNum;

    @TableField(exist = false)
    @ApiModelProperty(example = "其他订单数")
    @Excel(name = "其他订单数")
    private Integer otherOrderNum=0;

    @TableField(exist = false)
    @ApiModelProperty(example = "订单金额")
    @Excel(name = "订单金额")
    private BigDecimal orderMoney= new BigDecimal(0);

    @TableField(exist = false)
    @ApiModelProperty(example = "预约订单数")
    @Excel(name = "预约订单数")
    private Integer purchaseNum=0;

    @TableField(exist = false)
    @ApiModelProperty(example = "预约金额")
    @Excel(name = "预约金额")
    private BigDecimal purchaseMoney= new BigDecimal(0);

    @TableField(exist = false)
    @ApiModelProperty(example = "充值订单数")
    @Excel(name = "充值订单数")
    private Integer rechargeNum =0;


    @TableField(exist = false)
    @ApiModelProperty(example = "充值金额")
    @Excel(name = "充值金额")
    private BigDecimal rechargeMoney = new BigDecimal(0);;

    @TableField(exist = false)
    @ApiModelProperty(example = "提现金额")
    @Excel(name = "提现金额")
    private BigDecimal cashMoney = new BigDecimal(0);

}
